package com.lvcoding.oauth2.authorization.code;

import java.util.ArrayList;
import java.util.List;

/**
 * @author wuyanshen
 * @description 描述
 * @date 2022-02-17 上午11:20
 */
public class Test {
    public static void main(String[] args) {
        List<String> list = new ArrayList();
        list.add("11");
        list.add("22");
        list.add("33");
        list.add("44");

        Object[] objects = list.toArray();
        for (Object object : objects) {
            String item = (String) object;
            System.out.println("item = " + item);
        }
        String[] objects1 = list.toArray(new String[0]);
        printItem(objects1);
    }

    public static void printItem(String... arr) {
        for (String s : arr) {
            System.out.println("s = " + s);
        }
    }
}
